﻿using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using yLibrary.windows.functionWindow;
using yLibrary.windows.loginWindow.loginWindowMsgBus;
using yLibrary.windows.loginWindow.router;

namespace yLibrary.windows.loginWindow
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class LoginWindow : Window
    {
        LoginWindowRouter router;
        public LoginWindow()
        {
            InitializeComponent();
            router = new LoginWindowRouter();
            LoginWindowMsgBus.LoginSuccessful += NavigateToFunctionWindow;
            router.NavigateTo(LoginMainFrame, "Login");
        }
        public void NavigateToFunctionWindow()
        {
            FunctionWindow functionWindow = new FunctionWindow();
            functionWindow.Show();
            this.Close();
        }
    }
}